//
//  MyButton.h
//  CanYouDoIt
//
//  Created by hoangtx on 7/6/13.
//
//

#ifndef CanYouDoIt_MyButton_h
#define CanYouDoIt_MyButton_h

#include "cocos2d.h"

using namespace cocos2d;

class MyButton: public CCNode{
protected:
    
    CCSize buttonSize;
    
public:
    CCCallFuncO* callback;
    bool isFocused;
    CCRect getBoundingRect();
    CCPoint getOriginPoint();
    void addCallback(CCCallFuncO* mCallback);
    static MyButton* create(double mX,double mY,double mWidth,double mHeight);
    bool isTouchedAt(CCSet* touches);
    virtual void updateState();
    virtual void resetState();
    virtual void onTouchButton();
    virtual void goToNormalMode();
    virtual void goToHighlightMode();
    virtual bool isTouchedAt(CCPoint touchPosition);
    virtual bool init();
    virtual void handleTouchesBegan(CCSet* touches, CCEvent* pEvent);
    virtual void handleTouchesMoved(CCSet* touches, CCEvent* pEvent);
    virtual void handleTouchesEnded(CCSet* touches, CCEvent* pEvent);
    
    virtual void handleMultiTouchesBegan(CCSet* touches, CCEvent* pEvent);
    virtual void handleMultiTouchesMoved(CCSet* touches, CCEvent* pEvent);
    virtual void handleMultiTouchesEnded(CCSet* touches, CCEvent* pEvent);
    CREATE_FUNC(MyButton);
};

#endif
